package edu.depaul.se.courseregistration.sessionbean;

import edu.depaul.se.courseregistration.jpa.courses.College;
import edu.depaul.se.courseregistration.jpa.courses.Course;
import edu.depaul.se.courseregistration.jpa.courses.Section;
import edu.depaul.se.courseregistration.jpa.courses.Subject;
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;

/**
 *
 * @author Group2
 */

@Stateless
@LocalBean
public class CourseSession {

    @EJB
    CourseEJB courseEJB;
    
    //Courses buisness APIs
    //@Override
    public List<Course> getAllCourse() {
        return courseEJB.getAllCourse();
    }
     
    //@Override
     public List<Course> findCourseBySubject(int subjectId) {
        return courseEJB.findCourseBySubject(subjectId);
    }
  
    //@Override
    public Course findCourseById(int courseNumber) {
        return courseEJB.findCourseById(courseNumber);
    }
    //@Override
    public Course findCourseByTitle(String courseTitle) {
         return courseEJB.findCourseByTitle(courseTitle);
    }
  
    //Sections buisness APIs
    
    
    //@Override
    public List<Section> getAllSections() {
        return courseEJB.getAllSections();
    }
    //@Override
    public Section findSectionById(int sectionId) {
        return courseEJB.findSectionById(sectionId);
    }
    
    
    //@Override
   public List <Section> findSectionByCourse(int courseNumber) {
        return courseEJB.findSectionByCourse(courseNumber);
    }
    
    //@Override
    public List <Section> findSectionByIsOpen(boolean isOpen) {
         return courseEJB.findSectionByIsOpen(isOpen);
    }

    //Subject buisness APIs  
   // @Override
    public List<Subject> getAllSubjects() {
         return courseEJB.getAllSubjects();
    }
    
    //@Override
    public List <Subject> findSubjectByCollege(int collegeId) {
        return courseEJB.findSubjectByCollege(collegeId);
    }
    //@Override
    public Subject findSubjectById(int subjectId) {
        return courseEJB.findSubjectById(subjectId);
    }
    
    public Subject findSubjectByCode(String subjectCode) {
        return courseEJB.findSubjectByCode(subjectCode);
    }
    
    //College buisness APIs
    
    public List<College> getAllColleges() {
        return courseEJB.getAllColleges();
    }
    
    public College findCollegeById(int collegeId) {
           return courseEJB.findCollegeById(collegeId);
    }
    
    public College findCollegeByShortName(String collegeShortName) {
        return courseEJB.findCollegeByShortName(collegeShortName);
    }  
}
